import request from '@/utils/request'

// 查询周报列表
export function listAnxinWeekly(query) {
  return request({
    url: '/weekly/anxinWeekly/list',
    method: 'get',
    params: query
  })
}

// 查询周报详细
export function getAnxinWeekly(id) {
  return request({
    url: '/weekly/anxinWeekly/' + id,
    method: 'get'
  })
}

// 保存周报
export function saveAnxinWeekly(data) {
  return request({
    url: '/weekly/anxinWeekly/save',
    method: 'post',
    data: data
  })
}

// 删除周报
export function delAnxinWeekly(id) {
  return request({
    url: '/weekly/anxinWeekly/' + id,
    method: 'delete'
  })
}

// 导出周报
export function exportAnxinWeekly(query) {
  return request({
    url: '/weekly/anxinWeekly/export',
    method: 'get',
    params: query
  })
}

// 根据用户id和yearWeek验证是否已填写周报
export function checkWeekly(yearWeek) {
  return request({
    url: '/weekly/anxinWeekly/checkWeekly/' + yearWeek,
    method: 'get'
  })
}

// 根据yearWeek删除周报
export function delWeekly(yearWeek) {
  return request({
    url: '/weekly/anxinWeekly/delWeekly/' + yearWeek,
    method: 'delete'
  })
}

// 根据yearWeek获取周报
export function getByYearWeek(data) {
  return request({
    url: '/weekly/anxinWeekly/getByYearWeek/' + data.yearWeek,
    method: 'get',
    params: { createBy: data.createBy }
  })
}
// 查询周报统计报表
export function weekReportlist(query) {
  return request({
    url: '/weekly/anxinWeekly/weekReportlist',
    method: 'get',
    params: query
  })
}

// 查询项目时长统计报表
export function anxinDealDurationList(start, end, deptId) {
  return request({
    url: '/weekly/anxinWeekly/anxinDealDurationList?start=' + start + '&end=' + end + '&deptId=' + deptId,
    method: 'get'
  })
}

// 查询周报时长统计报表
export function weekCheckReportList(query) {
  return request({
    url: '/weekly/anxinWeekly/weekCheckReportList',
    method: 'get',
    params: query
  })
}

export function preSaleWeeklyReportList(query) {
  return request({
    url: '/weekly/anxinWeekly/preSaleWeeklyReportList',
    method: 'get',
    params: query
  })
}

export function trackInfoByUser(query) {
  return request({
    url: '/weekly/anxinWeekly/trackInfoByUser',
    method: 'get',
    params: query
  })
}
